import request from '@/utils/request'

// 提交用餐缴费订单
export function submitMealOrder(data) {
  return request({
    url: '/app/order/create',
    method: 'post',
    data: data
  })
}

// 获取用餐缴费订单详情
export function getMealOrderDetail(orderId) {
  return request({
    url: '/meal/order/detail',
    method: 'get',
    params: {
      orderId
    }
  })
}

// 获取用餐缴费订单列表
export function getMealOrderList(query) {
  return request({
    url: '/meal/order/list',
    method: 'get',
    params: query
  })
}

// 取消用餐缴费订单
export function cancelMealOrder(orderId) {
  return request({
    url: '/meal/order/cancel',
    method: 'post',
    data: {
      orderId
    }
  })
}

// 支付用餐缴费订单
export function payMealOrder(data) {
  return request({
    url: '/meal/order/pay',
    method: 'post',
    data: data
  })
}

// 获取用餐价格配置
export function getMealPriceConfig(id) {
  return request({
    url: `/app/order/canteenManager/${id}`,
    method: 'get'
  })
}

// 获取用餐时间配置
export function getMealTimeConfig() {
  return request({
    url: '/meal/config/time',
    method: 'get'
  })
} 
//校验重复订单
export function checkRepeatOrder(data) {
  return request({
    url: '/app/order/checkRepeat',
    method: 'post',
    data: data
  })
}

//校验企业微信用户
export function checkQwUser(data) {
  return request({
    url: '/app/qywx/checkQwUser',
    method: 'post',
    data: data
  })
}
